package com.zjw.xm.xmuser.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zjw.xm.entity.CrBook;
import com.zjw.xm.entity.CrBought;
import com.zjw.xm.entity.CrCart;
import com.zjw.xm.entity.CrUser;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface CrBoughtMapper extends BaseMapper<CrBought> {

    @Delete("delete * from cr_cart where uid=#{id} ")
    void clearCart(int id);


    @Select("select * from cr_cart where uid = #{id} ")
    List<CrBought> selectCart(int id);


    @Select("select id from cr_cart where uid = #{id} ")
    List<Integer> selectCartId(int id);

    @Delete("delete from cr_cart where id =#{id} ")
    void deleteByCid(int id);
}
